package com.kisnow.security.controller;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class ViewCtrl {

    @GetMapping("/authorization")
    public String authorization(HttpSession session) {
        session.setAttribute("Authorization", "Bearer OH HO!!");
        return "authorization";
    }

    @GetMapping("/logout")
    public String logout() {
        return "logout";
    }

    @GetMapping("/api/index")
    public String index() {
        return "Spring Security";
    }

    @GetMapping("/api/source")
    public String source() {
        return "Spring Security source";
    }
}
